--[[
 * 增加已损失血量%的属性
 ]]
BuffEffect25 = ClientFight.CreateClass("BuffEffect25", ClientFight.BaseBuffEffect)

---@class BuffEffect25 : BaseBuffEffect
local t = BuffEffect25
t.BUFF_EFFECT_PARAMETERS_21_ = "BUFF_EFFECT_PARAMETERS_21_"
---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local fighter = nil;
    if (buff.buffBean.f_BuffEffectValue[2] == 0) then
        fighter = buff.source;
    else
        fighter = buff.target;
    end
    -- 基础值
    local baseValue = buff.buffBean.f_BuffEffectValue[1];
    local attrType = buff.buffBean.f_BuffEffectValue[3];
    local percent = (buff.buffBean.f_BuffEffectValue[4] * buff.overlay);
    local hp = fighter.hp;
    local maxHp = FighterAttributeManager.getFightAttr(fighter, FighterAttributeEnum.HP.id);
    local add = ((maxHp - hp) * percent / Global.TEN_THOUSANDTH + baseValue);

    buff.attributes.attributes[attrType] = add;
    SkillRoleMgr.savePathFile("[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff:"
            .. buff.modelId .. " 触发增加已损失血量%的属性BUFF效果，增加(" .. buff.buffBean.f_BuffEffectValue[3] .. ")" .. add);
    ClientFight.BaseBuffEffect.action(self, fight, buff, parameters);
    return IBuffEffect.SUCCESS_ATTRI_HAS_CHANGE;
end

t.New()